//
//  OpenScribbleCommand.m
//  Test
//
//  Created by 杨德龙 on 2017/11/24.
//  Copyright © 2017年 ___杨德龙___. All rights reserved.
//

#import "OpenScribbleCommand.h"
#import "CoordinatingController.h"

@implementation OpenScribbleCommand

@synthesize scribbleSource = scribbleSource_;

- (instancetype)initWithScribbleSource:(id<ScribbleSource>)aScribbleSource
{
    if (self = [super init]) {
        [self setScribbleSource:aScribbleSource];
    }
    return self;
}

- (void)execute
{
    // get a scribble from the scribbleSource
    Scribble *scribble = [scribbleSource_ scribble];
    // set it to the current canvasViewController
    CoordinatingController *coordinate = [CoordinatingController sharedInstance];
    CanvasViewController *vc = [coordinate canvasViewController];
    [vc setScribble:scribble];
    //  跳转新的 界面  打开 
    [coordinate requestViewChangeByObject:self];
}



@end
